<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/pages/share/taglib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>运城市安全生产隐患排查治理信息系统</title>
<link href="<%=basePath%>/css/style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=basePath%>/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/jquery.cookie.js"></script>
<script type="text/javascript">
	$(function() {
		 var username = $.cookie('username');  
		 if(username != null) {
		 	//alert(username);
		 	$("#corpName").val(username);
		 	 $('#checkUsername').attr('checked', true);  
		 }
	});
	function randRefresh(img,baseUrl){
	    		img.src = ""; //不加这句刷新不生效
	    		img.src =baseUrl + "/img.action";
	    }
   	function checkspace(checkstr) {
		var str = '';
		for(i = 0; i < checkstr.length; i++) {
			str = str + ' ';
		}
		return (str == checkstr);
	}
	function check(){
	var username = document.loginform.corpName.value;
		if(checkspace(document.loginform.corpName.value))  {		
			alert("对不起，用户名不能为空，请重新输入！");
			document.loginform.corpName.focus();
			return false;
		}	
		if(checkspace(document.loginform.passowrd.value))  {		
			alert("对不起，密码不能为空，请重新输入！");
			document.loginform.passowrd.focus();
			return false;
		}
		if(checkspace(document.loginform.rand.value))  {		
			alert("对不起，验证码不能为空，请重新输入！");
			document.loginform.rand.focus();
			return false;
		}
		if($('#checkUsername').attr('checked')){  
                    $.cookie('username', username, {expires:30});  
                }else{  
                    $.cookie('username', null);  
                }  
		return true;
	}
</script>
</head>
<body>
<div id="allbody">
	<div class="head"> <img src="<%=basePath%>/images/head.jpg"/>
		<div class="menu" style="letter-spacing:2px;"> &nbsp;&nbsp;&nbsp;<strong>欢迎使用运城市安全生产隐患排查治理信息系统！</strong> </div>
	</div>
	<div class="login">
		<form id="loginform" name="loginform" action="<%=basePath%>/login/login.action" method="post" >
			<div class=login_info> 
				<h1>用户名：<input id="corpName" class="input" name="corpName"></h1>
				<h1>密　码：<input id="passowrd" class="input" type="password" name="password"></h1>
				<h2>验证码：<input id="rand" class="input1" name="rand">
				<span id="inrandspan"><img style="CURSOR: hand" onclick="javascript:randRefresh(this,'<%=basePath%>');" alt=看不清，换一张图片 src="<%=basePath%>/img.action"></span></h2>
<h2><input type="checkbox" name="remember" id="checkUsername" value="1"/>记住用户名<input onclick="return check()" src="<%=basePath%>/images/login.gif" type=image> </h2>
			</div>
		</form>
	</div>
	<div class="foot">
		<iframe src="<%=basePath%>/foot.html" width="1160" height="89" scrolling="no" frameborder="0" ></iframe>
	</div>
</div>
<s:if test="%{tip!=null}">
	<script>
		alert('${tip}');
	</script>
</s:if>
</body>
</html>
